package BehavioralModel.StrategyPattern;

/**
 * @author 王蕾 [wanglei_dev@cyou-inc.com]
 * @date 2017-12-07 15:25:00
 */
public class CashClient {

    double total = 0.0d;

    public static void main(String[] args) {

        //正常收费
        CashContext normal  = new CashContext(new CashNormal());
        System.out.println("没有打折活动："+normal.getResult(800));

        //打八折收费
        CashContext rebate  = new CashContext(new CashRebate(0.8));
        System.out.println("没有打折活动："+rebate.getResult(800));

        //满500-100
        CashContext cashRetrun = new CashContext(new CashReturn(500,100));
        System.out.println("满500-100："+cashRetrun.getResult(800));

    }

}
